//
//  
//	GSM-Link - a free SMS messaging library for .NET
//	Copyright (C) 2003 Cris Almodovar
//
//	This library is free software; you can redistribute it and/or
//	modify it under the terms of the GNU Lesser General Public
//	License as published by the Free Software Foundation; either
//	version 2.1 of the License, or (at your option) any later version.
//
//	This library is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
//	Lesser General Public License for more details.
//
//	You should have received a copy of the GNU Lesser General Public
//	License along with this library; if not, write to the Free Software
//	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//

using System;

namespace GsmLink.Persistence
{	
	public interface IPersistenceProvider
	{
		//bool Initialize();
		//void Shutdown();
		void SaveMessage(string deviceName, SmsMessage message);		
		void SaveMessages(string deviceName, SmsMessage[] messages);		
		SmsMessage[] GetMessages(string deviceName, MessageStatus status);		
	}

	public abstract class PersistenceProvider : IPersistenceProvider
	{
		public PersistenceProvider()
		{			
		}

		// NOTE: It is recommended that this method be implemented as an asynchronous operation.
		public abstract void SaveMessage(string deviceName, SmsMessage message);		
		public abstract void SaveMessages(string deviceName, SmsMessage[] messages);
		public abstract SmsMessage[] GetMessages(string deviceName, MessageStatus status);
	}

	/// <summary>
	/// Provides a mechanism for persisting SMS messages, using 
	/// Comma Separated Values (CSV) files as data store.
	/// </summary>
	public class CsvPersistenceProvider : PersistenceProvider
	{
		public override void SaveMessage(string deviceName, SmsMessage message)
		{
			throw new NotImplementedException("This method is not yet implemented.");
		}

		public override void SaveMessages(string deviceName, SmsMessage[] messages)
		{
			throw new NotImplementedException("This method is not yet implemented.");
		}

		public override SmsMessage[] GetMessages(string deviceName, MessageStatus status)
		{
			throw new NotImplementedException("This method is not yet implemented.");
		}
	}

	/// <summary>
	/// Provides a mechanism for persisting SMS messages, using 
	/// XML files as data store.
	/// </summary>
	public class XmlPersistenceProvider : PersistenceProvider
	{
		public override void SaveMessage(string deviceName, SmsMessage message)
		{
			throw new NotImplementedException("This method is not yet implemented.");
		}

		public override void SaveMessages(string deviceName, SmsMessage[] messages)
		{
			throw new NotImplementedException("This method is not yet implemented.");
		}

		public override SmsMessage[] GetMessages(string deviceName, MessageStatus status)
		{
			throw new NotImplementedException("This method is not yet implemented.");
		}
	}
	
}
